package ooday04;
import java.util.Timer;
import java.util.TimerTask;
public class TimerDemo {
    public static void main(String[] args) {
        /*
        Timer timer=new Timer();//定时器对象
        int interval=1000;      //定时间隔

        timer.schedule(new TimerTask() {
            public void run() {
                System.out.println("该练习代码了");
            }
        }, interval,interval);//定时计划表
    }

         */

        Timer timer=new Timer();
        int interval=1000;
        timer.schedule(new TimerTask(){
            public void run() {
                System.out.println("保留所有权利");
            }
    },interval,interval);

}
}